<%--
  Created by IntelliJ IDEA.
  User: 曾小丽
  Date: 2018/4/9
  Time: 15:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>

<script type="text/javascript" src="${pageContext.request.contextPath}/statics/js/jquery-1.12.4.js"></script>
<script type="text/javascript">
    function del(id){
        $.get("/del?rid=" + id,function(data){
            if("success" == data.result){
                alert("删除成功");
                window.location.reload();
            }else{
                alert("删除失败");
            }
        });
    }
</script>

<body>
<center>
    <table>
        <tr>
            <td>id</td>
            <td>角色编码</td>
            <td>角色昵称</td>
            <td >创建日期</td>
            <td>操作</td>
        </tr>
        <c:forEach items="${roleInfo}" var="r" varStatus="st">
            <tr <c:if test="${st.index%2!=0}">style="color: blueviolet" </c:if>
                <td>  </td>
                <td>${r.id}</td>
                <td>${r.roleCode}</td>
                <td>${r.roleName}</td>
                <td>${r.creationDate}</td>
                <td>
                    <a href="javascript:del('${r.id }')">删除</a>
                    <a href="/update?rid=${r.id}">修改</a>
                </td>
            </tr>
        </c:forEach>
    </table>

   <a href="/add">新增用户信息</a>
</center>

</body>
</html>
